package com.mf.springboot.backend.userAuth.controller;

import com.mf.springboot.backend.commonModule.common.UUIDGeneratorUtil;
import com.mf.springboot.backend.commonService.service.TLoginUserService;
import com.mf.springboot.backend.mybatisModule.entity.TLoginUser;
import com.mf.springboot.backend.mybatisModule.entity.TLoginUserExample;
import com.mf.springboot.backend.userAuth.service.LoginService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by lx on 2017/3/26.
 */
@Controller
@RequestMapping("test")
public class TestController {
    protected static Logger logger= LoggerFactory.getLogger(TestController.class);

    @Resource
    private TLoginUserService loginUserService;

    @RequestMapping("/test")
    @ResponseBody
    public List test() {
        List list = null;
        try {
            TLoginUser tLoginUser = new TLoginUser();
            tLoginUser.setId(UUIDGeneratorUtil.generate());
            tLoginUser.setPassword("888888");
            loginUserService.insertLoginUser(tLoginUser);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }


    @RequestMapping("/test1")
    @ResponseBody
    public List test1() {
        List list = null;
        try {
            TLoginUserExample example = new TLoginUserExample();
            list = loginUserService.selectByExample(example);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

}
